{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "数据不正确，无解\n"
     ]
    }
   ],
   "source": [
    "jitu, tui = map(int, input('请输入鸡兔总数和腿总数:   ').split( ) )\n",
    "tu = (tui - jitu * 2) / 2\n",
    "if int(tu) == tu and 0 < tu <= jitu:\n",
    "    ji = jitu - tu\n",
    "    print('鸡：{0}，兔：{1}'.format(int(ji), int(tu)))  \n",
    "else:\n",
    "   print('数据不正确，无解')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.9"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
